﻿using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;

namespace Practical.SharePoint.Base.WebParts
{
    public class My
    {
        private readonly Collection<MySite> _sites = new Collection<MySite>();

        public Collection<MySite> MySites
        {
            get { return _sites; }
        }

        public void Sort()
        {
            List<MySite> items = new List<MySite>(_sites);
            items.Sort();
        }

        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();
            foreach (var mySite in _sites)
            {
                sb.Append("," + mySite.Title + " " + mySite.Url);
            }
            return sb.ToString();
        }
    }
}
